# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=ibus-sunpinyin
_pkgname=sunpinyin
pkgver=3.0.0rc1+32+gf39c195
pkgrel=3
pkgdesc="IBus Wrapper for sunpinyin"
arch=('loong64' 'x86_64')
url="https://github.com/sunpinyin/sunpinyin"
license=('LGPL')
depends=('sunpinyin' 'sunpinyin-data' 'ibus' 'gtk3' 'python-gobject')
makedepends=('git' 'scons')
_commit=f39c195db08661e894017507842991a1ef70bedf  # master
source=("git+https://github.com/sunpinyin/sunpinyin.git#commit=$_commit")
md5sums=('SKIP')

pkgver() {
  cd $_pkgname
  git describe --tags | sed 's/^v//;s/-rc/rc/;s/-/+/g'
}

build() {
  cd "$_pkgname/wrapper/ibus"
  
  scons \
    --prefix=/usr
}

package() {
  cd "$_pkgname/wrapper/ibus"

  scons \
    --prefix=/usr \
    --install-sandbox="$pkgdir" \
    install
}
